package com.weixing.mall.base.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;

/**
 * 基础枚举
 *
 * @author  siashan
 * @since  1.0
 **/
@JsonSerialize(using = BaseEnumSerializer.class)
@JsonDeserialize(using = BaseEnumDeserializer.class)
public interface IBaseEnum<T extends Serializable> extends IEnum<T> {

    @Override
    T getValue();

    String getDesp();

    static <T extends  Enum<T> & IEnum> T valueOf(String enumCode, Class<T> clazz) {
        T enumm = Enum.valueOf(clazz, enumCode);
        return enumm;
    }
}
